package com.ruoyi.project.men.api;


import com.ruoyi.common.utils.bootdo.R;
import com.ruoyi.project.men.domain.MenEcologicalServicesDO;
import com.ruoyi.project.men.service.MenEcologicalServicesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * 生态服务
 */
@Controller
@RequestMapping("/api/ecological")
public class ApiEcologicalController {

    @Autowired
    private MenEcologicalServicesService menEcologicalServicesService;

    @PostMapping( "/getEcologicalIntro")
    @ResponseBody
    public R getEcologicalIntro(){

        try{
            Map<String,Object> map = new HashMap<>();
            map.put("delFlag","0");
            List<MenEcologicalServicesDO> menEcologicalServicesDOList = menEcologicalServicesService.list(map);
            return R.ok().put("data",menEcologicalServicesDOList);
        }catch (Exception e){
            return R.error("服务器网络异常");
        }
    }
}
